-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
dcc redesign: DatePickerSingle and DatePickerRange
#3495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Conversation
b2d62da to
de88f2b
Compare
de88f2b to
75fd1fe
Compare
|
Wow! First look at this is amazing 🤩 I love how you can easily skip months and years - that's been a pain point in the old date pickers for a long time. This is an incredible amount of work given that the Radix components does not have date pickers and you had to build all of this from scratch. I see you are still using moment.js for the date formatting. Since they are no longer recommending moment.js to be used in new project, would you consider using one of their recommended alternatives? It might make it easier to add support for locale at some point https://momentjs.com/docs/#/-project-status/ |
|
Thanks @AnnMarieW ! And wow, I did not realize moment was fading away like that! I will take a look at replacing moment - it shouldn't be too much effort there.
|
T4rk1n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
components/dash-core-components/src/components/DatePickerRange.tsx
Outdated
Show resolved
Hide resolved
components/dash-core-components/src/fragments/DatePickerRange.tsx
Outdated
Show resolved
Hide resolved
I would also recommend we change to something else, I don't think we use that much moment.js. Luxon seems like a good alternative, I also had a good experience with |
Oh nice, |
|
Sorry to comment on this after you already moved to For example with Also, the |
Excellent call @AnnMarieW ! It does support adding locales like that (or from the @ndrezn |
|
Wow - that's so awesome that you included the locale now. I just wanted to make sure it was possible to add at some point since this has been a frequently requested feature. I think it's OK to document how to add the extra script, since this is a new feature. |
oh that's great then! For some reason, I had thought that moment.js had translations bundled in and handled them automatically. But if this actually adds a new translation feature, then even better! |
682d832 to
ab88a95
Compare
At long last, here is a PR to modernize the date pickers.
You can play with them here:
https://dcc-redesign.plotly.app/datepickers-single
https://dcc-redesign.plotly.app/datepickers-range
Some improvements:
dcc.Dropdown's look and feelCloses #3391
Fixes https://github.com/plotly/dash-design-kit/issues/1504